package com.itlong.cloud.user.app;

import com.alibaba.fastjson.JSONObject;
import com.itlong.cloud.POJO.PO.DevicePadInfoPO;
import com.itlong.cloud.POJO.PO.SpecialDevicePadInfoPO;
import com.itlong.cloud.POJO.VO.app.*;
import com.itlong.cloud.POJO.VO.property.CloudDeviceUpdateInfoVO;
import com.itlong.cloud.POJO.VO.property.CloudElevatorVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * <desc>
 *     平板人脸接口代理
 * </desc>
 * @createDate 2018/05/14
 */
@FeignClient(name="user-service")
public interface IAppPadFaceServiceClient {

    /**
     * <desc>
     *      判断项目是否禁用。
     * <desc/>
     *
     * @param projectId 项目编号
     * @return
     * @author Qiang.S
     * @createDate 2018-06-13
     */
    @RequestMapping(path = "/padFace/checkProjectForbidden",method = RequestMethod.POST)
    Integer checkProjectForbidden(@RequestParam("projectId") String projectId) throws Exception;

    /**
     * <desc>
     *      设备验证(梯控)。
     * <desc/>
     *
     * @param projectId 项目编号
     * @param deviceId 项目ID
     * @param elevatorType 电梯类型
     * @param isFaceRecognition 是否支持人脸识别
     * @return
     * @author Qiang.S
     * @createDate 2018-05-14
     */
    @RequestMapping(path = "/padFace/elevatorAuthorityCheck",method = RequestMethod.POST)
    String elevatorAuthorityCheck(@RequestParam("projectId") String projectId,@RequestParam("deviceId") String deviceId,
                                  @RequestParam("elevatorType") String elevatorType,@RequestParam("isFaceRecognition") String isFaceRecognition) throws Exception;

    /**
     * <desc>
     *      设备验证(群控器)。
     * <desc/>
     *
     * @param projectId 项目编号
     * @param deviceId 项目ID
     * @return
     * @author Qiang.S
     * @createDate 2018-05-14
     */
    @RequestMapping(path = "/padFace/controllerAuthorityCheck",method = RequestMethod.POST)
    String controllerAuthorityCheck(@RequestParam("projectId") String projectId,@RequestParam("deviceId") String deviceId) throws Exception;

    /**
     * <desc>
     *      设备验证(门禁)。
     * <desc/>
     *
     * @param projectId 项目编号
     * @param deviceId 项目ID
     * @param isFaceRecognition 是否支持人脸识别
     * @return
     * @author Qiang.S
     * @createDate 2018-05-14
     */
    @RequestMapping(path = "/padFace/entranceAuthorityCheck",method = RequestMethod.POST)
    String entranceAuthorityCheck(@RequestParam("projectId") String projectId,@RequestParam("deviceId") String deviceId,
                                  @RequestParam("isFaceRecognition") String isFaceRecognition) throws Exception;

    /**
     * <desc>
     *      登陆验证。
     * <desc/>
     *
     * @param projectId 项目编号
     * @param userName 账号
     * @param password 密码
     * @return
     * @author Qiang.S
     * @createDate 2018-05-14
     */
    @RequestMapping(path = "/padFace/engineerLoginVerify",method = RequestMethod.POST)
    Integer engineerLoginVerify(@RequestParam("projectId") String projectId,@RequestParam("userName") String userName, @RequestParam("password") String password) throws Exception;

    /**
     * <desc>
     *      登陆项目验证。
     * <desc/>
     *
     * @param projectId 项目编号
     * @param userName 账号
     * @return
     * @author Qiang.S
     * @createDate 2018-06-08
     */
    @RequestMapping(path = "/padFace/engineerLoginProjectVerify",method = RequestMethod.POST)
    Integer engineerLoginProjectVerify(@RequestParam("projectId") String projectId,@RequestParam("userName") String userName) throws Exception;

    /**
     * <desc>
     *      工程人员帐号是否存在验证。
     * <desc/>
     *
     * @param userName 账号
     * @return
     * @author Qiang.S
     * @createDate 2018-06-11
     */
    @RequestMapping(path = "/padFace/engineerLoginExistsVerify",method = RequestMethod.POST)
    Integer engineerLoginExistsVerify(@RequestParam("userName") String userName) throws Exception;

    /**
     * <desc>
     *     平板获取广告(梯控)。
     * <desc/>
     *
     * @param projectId 项目编号
     * @param deviceId 项目ID
     * @return
     * @author Qiang.S
     * @createDate 2018-05-14
     */
    @RequestMapping(path = "/padFace/getElevatorAD",method = RequestMethod.POST)
    List<AppPadADVO> getElevatorAD(@RequestParam("projectId") String projectId, @RequestParam("deviceId") String deviceId) throws Exception;

    /**
     * <desc>
     *     平板获取广告(门禁)。
     * <desc/>
     *
     * @param projectId 项目编号
     * @param deviceId 项目ID
     * @return
     * @author Qiang.S
     * @createDate 2018-05-14
     */
    @RequestMapping(path = "/padFace/getEntranceAD",method = RequestMethod.POST)
    List<AppPadADVO> getEntranceAD(@RequestParam("projectId") String projectId, @RequestParam("deviceId") String deviceId) throws Exception;

    /**
     * <desc>
     *     通过projectId和deviceId获取deviceUnique。
     * <desc/>
     *
     * @param type 设备类型
     * @param projectId 项目编号
     * @param deviceId 设备机号
     * @return
     * @author Qiang.S
     * @createDate 2018-05-16
     */
    @RequestMapping(path = "/padFace/getDeviceUnique",method = RequestMethod.POST)
    AppPadDeviceVO getDeviceUnique(@RequestParam("type") String type,
                                   @RequestParam("projectId") String projectId,
                                   @RequestParam("deviceId") String deviceId) throws Exception;


    /**
     * <desc>
     *      获取用户账户金额。
     * <desc/>
     *
     * @param userId 用户编号
     * @return
     * @author shengen.T
     * @createDate 2018-05-24
     */
    @RequestMapping(path = "/padFace/getUserAccountMoney",method = RequestMethod.POST)
    BigDecimal getUserAccountMoney(@RequestParam("userId") String userId) throws Exception;

    /**
     * <desc>
     *      获取平板更新信息。
     * <desc/>
     *
     * @param type 更新类型；1为人脸识别客户端，2为人脸识别服务端
     * @return
     * @author Qiang.S
     * @createDate 2018-05-31
     */
    @RequestMapping(path = "/padFace/getPadProgramInfo",method = RequestMethod.POST)
    AppPadProgramInfoVO getPadProgramInfo(@RequestParam(value ="type",required = false) String type) throws Exception;

    /**
     * <desc>
     *      判断当前平板设备唯一码的设备是否存在或是否被禁用。
     * <desc/>
     *
     * @param padDeviceUnique 设备唯一码
     * @return
     * @author Juguang.S
     * @createDate 2019-01-18
     */
    @RequestMapping(path = "/padFace/getPadDeviceExist",method = RequestMethod.POST)
    String getPadDeviceExist(@RequestParam("padDeviceUnique") String padDeviceUnique);

    /**
     * <desc>
     *      根据baiduId来更新绑定百度识别授权码的设备信息。
     * <desc/>
     *
     * @param projectId 项目编号
     * @param emId emId
     * @param baiduId 百度ID
     * @param padDeviceUnique 平板设备唯一码
     * @param requestType 请求类型  1代表离线验证接口调用  2代表绑定激活码接口调用
     * @return 百度识别码
     * @author Juguang.S
     * @createDate 2019-01-18
     */
    @RequestMapping(path = "/padFace/bingBaiDuAuthCode",method = RequestMethod.POST)
    String bingBaiDuAuthCode(@RequestParam("projectId") String projectId,
                             @RequestParam("emId") String emId,
                             @RequestParam("baiduId") String baiduId,
                             @RequestParam("padDeviceUnique") String padDeviceUnique,
                             @RequestParam("requestType") String requestType) throws Exception;

    /**
     * <desc>
     *      根据baiduId来更新绑定百度识别授权码的设备信息。
     * <desc/>
     *
     * @param baiduId 百度ID
     * @param code 3激活成功4激活失败
     * @param msg 失败信息
     * @return 百度识别码
     * @author Qiang.S
     * @createDate 2019-08-06
     */
    @RequestMapping(path = "/padFace/reportBaiDuAuthCode", method = RequestMethod.POST)
    Integer reportBaiDuAuthCode(@RequestParam("baiduId") String baiduId,
                                @RequestParam("code") String code,
                                @RequestParam("msg") String msg) throws Exception;

    /**
     * <desc>
     *      校验该平板机号有没被其它设备占用
     * <desc/>
     *
     * @param baiduId 百度ID
     * @param padDeviceUnique 平板设备唯一码
     * @return 百度识别码
     * @author Juguang.S
     * @createDate 2019-03-20
     */
    @RequestMapping(path = "/padFace/isDeviceIdUserd",method = RequestMethod.POST)
    Integer isDeviceIdUserd(@RequestParam("baiduId") String baiduId,
                            @RequestParam("padDeviceUnique") String padDeviceUnique);

    /**
     * <desc>
     *      根据人脸编号获取电梯信息。
     * <desc/>
     *
     * @param uId 百度人脸编号
     * @return
     * @author Qiang.S
     * @createDate 2019-02-27
     */
    @RequestMapping(path = "/padFace/getElevatorInfoByFaceId",method = RequestMethod.POST)
    List<AppPadVisitorElevatorInfoVO> getElevatorInfoByFaceId(@RequestParam("uId")String uId) throws Exception;

    /**
     * <desc>
     *      根据人脸编号获取门禁信息。
     * <desc/>
     *
     * @param uId 百度人脸编号
     * @return
     * @author Qiang.S
     * @createDate 2019-02-27
     */
    @RequestMapping(path = "/padFace/getDoorInfoByFaceId",method = RequestMethod.POST)
    List<AppDoorDevicesVO> getDoorInfoByFaceId(@RequestParam("uId")String uId) throws Exception;

    /**
     * <desc>
     *      获取项目的设备过期时间。
     * <desc/>
     *
     * @param projectId 项目编号
     * @return
     * @author Juguang.S
     * @createDate 2019-08-06
     */
    @RequestMapping(path = "/padFace/getDeviceCloudServiceCostEndTime",method = RequestMethod.POST)
    List<Map<String, Object>> getDeviceCloudServiceCostEndTime(@RequestParam("projectId") String projectId);

    /**
     * <desc>
     *      获取物业的联系方式。
     * <desc/>
     *
     * @param projectId 项目编号
     * @return
     * @author Juguang.S
     * @createDate 2019-08-15
     */
    @RequestMapping(path = "/padFace/getPropertyPhone",method = RequestMethod.POST)
    String getPropertyPhone(@RequestParam("projectId") String projectId);

    /**
     * <desc>
     *      注册平板iot。
     * <desc/>
     *
     * @param padDeviceUnique 平板机号
     * @return
     * @author Qiang.S
     * @createDate 2019-07-10
     */
    @RequestMapping(path = "/padFace/registerPadIot",method = RequestMethod.POST)
    CloudElevatorVO registerPadIot(@RequestParam("padDeviceUnique")String padDeviceUnique) throws Exception;

    /**
     * <desc>
     *      设备升级。
     * <desc/>
     *
     * @param deviceType 升级包类型；4 维护程序，5 业务程序，6 桌面程序，7 通信程序
     * @param deviceUnique 设备编号
     * @return
     * @author Qiang.S
     * @createDate 2019/12/06
     */
    @RequestMapping(path = "/padFace/deviceUpdate",method = RequestMethod.POST)
    List<CloudDeviceUpdateInfoVO> deviceUpdate(@RequestParam("deviceUnique")String deviceUnique, @RequestParam(value = "deviceType",required = false)String deviceType) throws Exception;

    /**
     * <desc>
     *      根据deviceUnique批量获取设备地址
     * </desc>
     *
     * @param bindDeviceUnique 平板绑定的的deviceUnique，多个以逗号隔开
     * @return
     * @Author Zhu.yj
     * @createDate  2019/12/16
     */
    @RequestMapping(path = "/padFace/updatePadBridgeInfo",method = RequestMethod.POST)
    Integer updatePadBridgeInfo(@RequestParam("bindDeviceUnique") String bindDeviceUnique, @RequestParam("padDeviceUnique") String padDeviceUnique, @RequestParam("projectId") String projectId, @RequestParam("mac") String mac) throws Exception;

    /**
     * <desc>
     *      获取平板绑定的设备数量
     * </desc>
     *
     * @param bindDeviceUniques
     * @return
     * @Author Zhu.yj
     * @createDate  2020/1/2
     */
    @RequestMapping(value = "/padFace/getBindDeviceCount",method = RequestMethod.POST)
    Integer getBindDeviceCount(@RequestParam("bindDeviceUniques") String bindDeviceUniques, @RequestParam("deviceType") String deviceType) throws Exception;

    /**
     * <desc>
     *      校验要绑定的设备中是否有普通门禁
     * </desc>
     *
     * @param bindDeviceUniques 绑定的门禁设备编号
     * @return 普通门禁数量
     * @Author Zhu.yj
     * @createDate  2020/1/8
     */
    @RequestMapping(value = "/padFace/checkCommonEntranceExist",method = RequestMethod.POST)
    Integer checkCommonEntranceExist(@RequestParam("bindDeviceUniques") String bindDeviceUniques) throws Exception;

    /**
     * <desc>
     *      根据平板绑定普通门禁编号处理数据
     * </desc>
     *
     * @param bindDeviceUniques 绑定的门禁设备编号
     * @return 普通门禁数量
     * @Author Qiang.S
     * @createDate  2020/02/20
     */
    @RequestMapping(value = "/padFace/getUserInfoByRoleId",method = RequestMethod.POST)
    Map<String,Object> getUserInfoByRoleId(@RequestParam("bindDeviceUniques") String bindDeviceUniques) throws Exception;

    /**
     * <desc>
     *      平板人脸识别仪上报设备的能力集信息
     * </desc>
     *
     * @param params 信息
     *
     * @Author pengwei
     * @createDate  2020/11/16
     */
    @RequestMapping(value = "/padFace/uploadDeviceInfo",method = RequestMethod.POST)
    void   uploadDeviceInfo(@RequestParam Map<String,String>  params) throws Exception;

    /**
     * <desc>
     *      获取设备是否存在
     * </desc>
     *
     * @param
     * @return
     * @author caoshuai
     * @createDate 2020/12/10 11:52
     */
    @RequestMapping(value = "/padFace/getDevicePadByDeviceUnique",method = RequestMethod.POST)
    DevicePadInfoPO getDevicePadByDeviceUnique(@RequestParam("deviceUnique") String deviceUnique);

    /**
     * <desc>
     *      保存
     * </desc>
     *
     * @param
     * @return
     * @author caoshuai
     * @createDate 2020/12/10 11:52
     */
    @RequestMapping(value = "/padFace/save",method = RequestMethod.POST)
    Integer save(@RequestBody SpecialDevicePadInfoPO specialDevicePadInfoPO) throws Exception;
}
